package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TeachingDesignContentMapper;
import com.ruoyi.system.domain.TeachingDesignContent;
import com.ruoyi.system.service.ITeachingDesignContentService;

/**
 * 教学设计内容Service业务层处理
 *
 * @author tyro
 * @date 2025-05-29
 */
@Service
public class TeachingDesignContentServiceImpl implements ITeachingDesignContentService
{
    @Autowired
    private TeachingDesignContentMapper teachingDesignContentMapper;

    /**
     * 查询教学设计内容
     *
     * @param id 教学设计内容主键
     * @return 教学设计内容
     */
    @Override
    public TeachingDesignContent selectTeachingDesignContentById(Long id)
    {
        return teachingDesignContentMapper.selectTeachingDesignContentById(id);
    }

    /**
     * 查询教学设计内容列表
     *
     * @param teachingDesignContent 教学设计内容
     * @return 教学设计内容
     */
    @Override
    public List<TeachingDesignContent> selectTeachingDesignContentList(TeachingDesignContent teachingDesignContent)
    {
        return teachingDesignContentMapper.selectTeachingDesignContentList(teachingDesignContent);
    }

    /**
     * 新增教学设计内容
     *
     * @param teachingDesignContent 教学设计内容
     * @return 结果
     */
    @Override
    public int insertTeachingDesignContent(TeachingDesignContent teachingDesignContent)
    {
        teachingDesignContent.setCreateTime(DateUtils.getNowDate());
        return teachingDesignContentMapper.insertTeachingDesignContent(teachingDesignContent);
    }

    /**
     * 修改教学设计内容
     *
     * @param teachingDesignContent 教学设计内容
     * @return 结果
     */
    @Override
    public int updateTeachingDesignContent(TeachingDesignContent teachingDesignContent)
    {
        teachingDesignContent.setUpdateTime(DateUtils.getNowDate());
        return teachingDesignContentMapper.updateTeachingDesignContent(teachingDesignContent);
    }

    /**
     * 批量删除教学设计内容
     *
     * @param ids 需要删除的教学设计内容主键
     * @return 结果
     */
    @Override
    public int deleteTeachingDesignContentByIds(Long[] ids)
    {
        return teachingDesignContentMapper.deleteTeachingDesignContentByIds(ids);
    }

    /**
     * 删除教学设计内容信息
     *
     * @param id 教学设计内容主键
     * @return 结果
     */
    @Override
    public int deleteTeachingDesignContentById(Long id)
    {
        return teachingDesignContentMapper.deleteTeachingDesignContentById(id);
    }

    /**
     * 根据教学设计id查询内容
     * @param id
     * @return
     */
    @Override
    public List<TeachingDesignContent> selectTeachingDesignContentByDesignId(Long id) {
        return teachingDesignContentMapper.selectTeachingDesignContentByDesignId(id);
    }
}
